package com.yuhanginfo.modules.web.entity;

import java.math.BigDecimal;
import java.util.Date;

import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Length;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.yuhanginfo.common.persistence.WebDataEntity;

/**
 * 订单管理Entity
 * @author yangs
 * @version 2017-09-18
 */
public class WebOrders extends WebDataEntity<WebOrders> implements Cloneable {
	
	private static final long serialVersionUID = 1L;
	private static final Logger logger =  LoggerFactory.getLogger(WebOrders.class);
	private String code;		// 订单号
	private String changeCode;
	private String payType;		// 支付方式:0额度 1现金
	private String state;		// 订单状态：1代付款，2待发货，3部分发货，4全部发货，5已完成，6已取消，7异常
	private String historyState;		// 订单异常之前的状态
	private String buyStoreName;		// 门店名称
	private String buyStoreCode;		// 门店号
	private Date payDate;		// 下单时间
	private String sysUserId;		// 业务员id
	private BigDecimal money;		// 订单金额
	private BigDecimal modifyMoney;
	private BigDecimal payMoney;		// 付款金额
	private String payNo;		// 付款金额
	private String transportType;		// 物流方式
	private BigDecimal freight;		// 运费
	private String receiveName;		// 收货人
	private String receivePhone;		// 收货地电话
	private String receiveAddress;		// 收货地址
	private String isHistory;		// 是否历史:0否，1是
	private String sysUserName; 
	private String userType;
	private String userName;
	private String suoStore;
	private String suoYe;
	private String xiaYeUser;
	private String type;
	private Date startTime;
	private Date endTime;
	private String goodsTotalMoney;
	private String fpReceiveName;
	private String fpReceivePhone;
	private String fpReceiveAddress;
	private String  dutyCode;
	private String company;
	private String payCode;
	
	private Date starPayDate;
	private Date endPayDate;
	

	private Date sendFinishTime;//发货完成时间
    private Integer userId;
    private String goodsName;
    
    private String isInvoice;//是否开票
    private String isFree;//是否包邮
    private Integer orderType;//订单类型：1.web商品下单2.套餐下单3.批量下单
    
	public String getGoodsName() {
		return goodsName;
	}

	public void setGoodsName(String goodsName) {
		this.goodsName = goodsName;
	}

	public Integer getUserId() {
		return userId;
	}

	public void setUserId(Integer userId) {
		this.userId = userId;
	}

	public String getGoodsTotalMoney() {
		return goodsTotalMoney;
	}

	public void setGoodsTotalMoney(String goodsTotalMoney) {
		this.goodsTotalMoney = goodsTotalMoney;
	}

	public String getFpReceiveName() {
		return fpReceiveName;
	}

	public void setFpReceiveName(String fpReceiveName) {
		this.fpReceiveName = fpReceiveName;
	}

	public String getFpReceivePhone() {
		return fpReceivePhone;
	}

	public void setFpReceivePhone(String fpReceivePhone) {
		this.fpReceivePhone = fpReceivePhone;
	}

	public String getFpReceiveAddress() {
		return fpReceiveAddress;
	}

	public void setFpReceiveAddress(String fpReceiveAddress) {
		this.fpReceiveAddress = fpReceiveAddress;
	}

	public String getDutyCode() {
		return dutyCode;
	}

	public void setDutyCode(String dutyCode) {
		this.dutyCode = dutyCode;
	}

	public String getCompany() {
		return company;
	}

	public void setCompany(String company) {
		this.company = company;
	}

	public String getPayCode() {
		return payCode;
	}

	public void setPayCode(String payCode) {
		this.payCode = payCode;
	}

	public String getSysUserName() {
		return sysUserName;
	}

	public void setSysUserName(String sysUserName) {
		this.sysUserName = sysUserName;
	}

	public String getUserType() {
		return userType;
	}

	public void setUserType(String userType) {
		this.userType = userType;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getSuoStore() {
		return suoStore;
	}

	public void setSuoStore(String suoStore) {
		this.suoStore = suoStore;
	}

	public String getSuoYe() {
		return suoYe;
	}

	public void setSuoYe(String suoYe) {
		this.suoYe = suoYe;
	}

	public String getXiaYeUser() {
		return xiaYeUser;
	}

	public void setXiaYeUser(String xiaYeUser) {
		this.xiaYeUser = xiaYeUser;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public Date getStartTime() {
		return startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}

	public Date getEndTime() {
		return endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}

	public WebOrders() {
		super();
	}

	public WebOrders(String id){
		super(id);
	}

	@Length(min=0, max=30, message="订单号长度必须介于 0 和 30 之间")
	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}
	
	@Length(min=0, max=11, message="支付方式:0现金,1账期长度必须介于 0 和 11 之间")
	public String getPayType() {
		return payType;
	}

	public void setPayType(String payType) {
		this.payType = payType;
	}
	
	@Length(min=0, max=11, message="订单状态：1代付款，2待发货，3部分发货，4全部发货，5已完成，6已取消，7异常长度必须介于 0 和 11 之间")
	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}
	
	@Length(min=0, max=11, message="订单异常之前的状态长度必须介于 0 和 11 之间")
	public String getHistoryState() {
		return historyState;
	}

	public void setHistoryState(String historyState) {
		this.historyState = historyState;
	}
	
	@Length(min=0, max=50, message="门店名称长度必须介于 0 和 50 之间")
	public String getBuyStoreName() {
		return buyStoreName;
	}

	public void setBuyStoreName(String buyStoreName) {
		this.buyStoreName = buyStoreName;
	}
	
	@Length(min=0, max=50, message="门店号长度必须介于 0 和 50 之间")
	public String getBuyStoreCode() {
		return buyStoreCode;
	}

	public void setBuyStoreCode(String buyStoreCode) {
		this.buyStoreCode = buyStoreCode;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@NotNull(message="下单时间不能为空")
	public Date getPayDate() {
		return payDate;
	}

	public void setPayDate(Date payDate) {
		this.payDate = payDate;
	}
	
	@Length(min=0, max=64, message="业务员id长度必须介于 0 和 64 之间")
	public String getSysUserId() {
		return sysUserId;
	}

	public void setSysUserId(String sysUserId) {
		this.sysUserId = sysUserId;
	}
	
	public BigDecimal getMoney() {
		return money;
	}

	public void setMoney(BigDecimal money) {
		this.money = money;
	}
	
	public BigDecimal getPayMoney() {
		return payMoney;
	}

	public void setPayMoney(BigDecimal payMoney) {
		this.payMoney = payMoney;
	}
	
	@Length(min=0, max=11, message="物流方式长度必须介于 0 和 11 之间")
	public String getTransportType() {
		return transportType;
	}

	public void setTransportType(String transportType) {
		this.transportType = transportType;
	}
	
	public BigDecimal getFreight() {
		return freight;
	}

	public void setFreight(BigDecimal freight) {
		this.freight = freight;
	}
	
	@Length(min=0, max=50, message="收货人长度必须介于 0 和 50 之间")
	public String getReceiveName() {
		return receiveName;
	}

	public void setReceiveName(String receiveName) {
		this.receiveName = receiveName;
	}
	
	@Length(min=0, max=13, message="收货地电话长度必须介于 0 和 13 之间")
	public String getReceivePhone() {
		return receivePhone;
	}

	public void setReceivePhone(String receivePhone) {
		this.receivePhone = receivePhone;
	}
	
	@Length(min=0, max=500, message="收货地址长度必须介于 0 和 500 之间")
	public String getReceiveAddress() {
		return receiveAddress;
	}

	public void setReceiveAddress(String receiveAddress) {
		this.receiveAddress = receiveAddress;
	}
	
	@Length(min=0, max=11, message="是否历史:0否，1是长度必须介于 0 和 11 之间")
	public String getIsHistory() {
		return isHistory;
	}

	public void setIsHistory(String isHistory) {
		this.isHistory = isHistory;
	}

	public Date getStarPayDate() {
		return starPayDate;
	}

	public void setStarPayDate(Date starPayDate) {
		this.starPayDate = starPayDate;
	}

	public Date getEndPayDate() {
		return endPayDate;
	}

	public void setEndPayDate(Date endPayDate) {
		this.endPayDate = endPayDate;
	}

	public Date getSendFinishTime() {
		return sendFinishTime;
	}

	public void setSendFinishTime(Date sendFinishTime) {
		this.sendFinishTime = sendFinishTime;
	}

	public String getChangeCode() {
		return changeCode;
	}

	public void setChangeCode(String changeCode) {
		this.changeCode = changeCode;
	}

	public BigDecimal getModifyMoney() {
		return modifyMoney;
	}

	public void setModifyMoney(BigDecimal modifyMoney) {
		this.modifyMoney = modifyMoney;
	}
	
	public WebOrders clone(){
		try{
		return (WebOrders)super.clone();
		}catch(Exception ex){
			logger.error(ex.getMessage(),ex);
			return null;
		}
	}

	public String getIsInvoice() {
		return isInvoice;
	}

	public void setIsInvoice(String isInvoice) {
		this.isInvoice = isInvoice;
	}

	public String getIsFree() {
		return isFree;
	}

	public void setIsFree(String isFree) {
		this.isFree = isFree;
	}

	public String getPayNo() {
		return payNo;
	}

	public void setPayNo(String payNo) {
		this.payNo = payNo;
	}

	public Integer getOrderType() {
		return orderType;
	}

	public void setOrderType(Integer orderType) {
		this.orderType = orderType;
	}
	
}